<template>
    <!-- 热门歌单列表 -->
    <ul class="tanxin">
        <li v-for="(item, index) in hotlist" :key="index">
            <div class="info">
                <img v-lazy="item.coverImgUrl" alt="">
                <i :title="item.name" class="cover" @click="$router.push(`/playlist/${item.id}`)"></i>
                <i :class="{'vip':item.highQuality}" ></i>
                <div class="listen tanxin">
                    <span>
                        <i class="headset"></i>
                        {{ item.trackCount }}万
                    </span>
                    <i title="播放" class="play"></i>
                </div>
            </div>
            <p :title="item.name" class="ellipsis" @click="$router.push(`/playlist/${item.id}`)">{{ item.name }}</p>
            <span class="band">
                <i class="by">by</i>
                <i class="name ellipsis" @click="$router.push(`/user/${item.creator.userId}`)">{{ item.creator.nickname }}</i>
                <i class="vip" v-show="item.creator.vipType!=0">
                    <img src="@/assets/images/public/vip.png" alt="">
                </i>
                <i class="star" v-show="item.highQuality">
                    <img src="../../assets/images/public/star.png"  alt="">
                </i>
            </span>
        </li>       
    </ul>
</template>

<script>
export default {
    data () {
        return {

        }
    },
    props: ["hotlist"],
}
</script>
 
<style lang = "less" scoped>
@import "../../assets/base.less";
ul {
    flex-wrap: wrap;
    display: flex;
    justify-content: flex-start !important;
    padding-bottom: 30px;
    li {
        cursor: pointer;
        width: 140px;
        height: 200px;
        padding-top: 40px;
        padding-right: 50px;
        &:nth-of-type(5n) {
            padding-right: 0;
        }
    }
    .info {
        position: relative;
        img {
            width: 140px;
            height: 140px;
        }
        .cover {
            cursor: pointer;
            position: absolute;
            top: 0;
            left: 0;
            height: 140px;
            width: 140px;
            background: url("../../assets/images/public/coverall.png") no-repeat 0px 0px;
        }
        .vip {
            position: absolute;
            top: 0;
            left: 0;
            width: 40px;
            height: 40px;
            display: block;
            background: url("@/assets/images/public/icon2.png") no-repeat -135px -220px;
        }
        .listen {
            width: 100%;
            height: 27px;
            background-color: rgba(0, 0, 0, 0.5);
            position: absolute;
            bottom: 0;
            left: 0;
        }
        span {
            color: #ccc;
            font-size: 12px;
            line-height: 27px;
            text-align: center;
        }
        .headset {
            float: left;
            width: 17px;
            height: 17px;
            margin: 2px 5px;
            background: url("../../assets/images/public/iconall.png") no-repeat -0px -18px;
        }
        .play {
            float: left;
            width: 17px;
            height: 17px;
            margin: 4px 8px;
            background: url("../../assets/images/public/iconall.png") no-repeat -0px -0px;
            &:hover {
                background-position: 0 -60px;
                cursor: pointer;
            }
        }
    }
    p {
        margin-top: 8px;
        font-size: 14px;
        line-height: 1.4;
        color: #000;
        vertical-align: middle;
        &:hover {
            text-decoration: underline;
        }
    }
    .band {
        margin-top: 8px;
        font-size: 12px;
        display: flex;
        align-items: center;
        .by {
            color: #999;
            margin: 0 5px 0 0;
        }
        .name {
            color: #666;
            &:hover {
                cursor: pointer;
                text-decoration: underline;
            } 
        }
        .vip {
            margin: 0 0 0 5px;
            img {
                width: 13px;
                height: 13px;
            }
        }
        .star {
            margin: 0 0 0 5px;
            img {
                width: 13px;
                height: 13px;
            }
        }
    }
}
</style>